package com.jeesite.modules.kj.api.vo.request;

import com.jeesite.common.lang.StringUtils;
import com.jeesite.modules.kj.entity.KjMember;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import springfox.documentation.annotations.ApiIgnore;

import javax.validation.constraints.NotBlank;

/**
 * Author:hzy
 * Date:2021/07/04
 * Description: 更新用户信息
 */
@Data
public class UpdateInfoRequestVo {

    @ApiModelProperty(value="id", example = "111")
    String id;
    @ApiModelProperty(value="邮件地址", example = "44554547@123.com")
    String email;
    @ApiModelProperty(value="证件号", example = "362112199803053332")
    String idcard;

    @ApiModelProperty(value="证件类型", example = "")
    String documentType;

    @ApiModelProperty(value="政府志愿者编号", example = "0001223")
    String volunteerNo;

    @ApiModelProperty(value="特长", example = "1,2,3,4")
    String skill;


    @ApiModelProperty(value="常驻地", example = "深圳")
    String address;


    @ApiModelProperty(value="头像", example = "http://wx-logo")
    String headImg;

    public KjMember convertToMember(){
        KjMember kjMember = new KjMember();
        if(StringUtils.isNotBlank(email)){
            kjMember.setEmail(email);
        }
        if(StringUtils.isNotBlank(skill)){
            kjMember.setSkill(skill);
        }
        if(StringUtils.isNotBlank(volunteerNo)){
            kjMember.setVolunteerNo(volunteerNo);
        }
        if(StringUtils.isNotBlank(idcard)){
            kjMember.setIdcard(idcard);
        }

        if(StringUtils.isNotBlank(documentType)){
            kjMember.setDocumentType(documentType);
        }

        if(StringUtils.isNotBlank(address)){
            kjMember.setAddress(address);
        }
        if(StringUtils.isNotBlank(headImg)){
            kjMember.setHeadimg(headImg);
        }
        return kjMember;
    }



}
